import java.util.Scanner;

/**
 * @author: gao
 * @create-date: 2025/3/8 8:32
 */

public class Solution {
    public int mySqrt(int x){
        if(x == 0) return 0;
        long left = 0,right = x;
        while(left < right){
            long mid = left + (right-left)/2;
            if(mid * mid <= x) left = mid;
            else right = mid-1;
        }
        return (int) left;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()){
            int x = in.nextInt();
            Solution solution = new Solution();
            System.out.println(solution.mySqrt(x));
        }
    }
}
